/**
 * @author 35326
 * 2021/3/17 18:15
 * 使用enum关键字自定义枚举类
 */

public class SeasonTest1{
    public static void main(String[] args) {
        @SuppressWarnings("unused")
        Season1 spring = Season1.SPRING;
        System.out.println(spring);
        System.out.println(Season1.class.getSuperclass());
        Season1[] values = Season1.values();
        for (Season1 value : values) {
            System.out.println(value);
        }
        System.out.println(Season1.valueOf("winter"));
    }
}
 enum Season1 {
    //1 提供当前枚举类的对象，多个对象之间用“，”隔开，末尾对象“；”结束
    SPRING("春天","春暖花开"),SUMMER("夏天","夏日炎炎"),
    AUTUMN("秋天","秋高气爽"),WINTER("冬天","白雪皑皑");

    private final String seasonName;
    private final String seasonDesc;

    Season1(String seasonName, String seasonDesc) {
        this.seasonName = seasonName;
        this.seasonDesc = seasonDesc;
    }

    public String getSeasonName() {
        return seasonName;
    }

    public String getSeasonDesc() {
        return seasonDesc;
    }
}


